package com.suyu.service;

import com.suyu.common.BaseResponse;
import com.suyu.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.suyu.model.vo.LoginUserVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author tmh
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2023-09-13 12:55:06
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @return
     */
    BaseResponse userRegister(String userAccount, String userPassword, String checkPassword);

    /**
     * 用户登录
     * @param userAccount
     * @param userPassword
     * @param request
     * @return
     */
    BaseResponse userLogin(String userAccount,String userPassword/*,String captcha*/,HttpServletRequest request);

    BaseResponse userLogout(HttpServletRequest request);

    /**
     * 获取当前的登录用户
     * @param request 请求对象
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 获取的脱敏的已经登录的用户信息
     * @param user
     * @return
     */
    LoginUserVO getLoginUserVo(User user);
}
